package com.luaj.elasticsearch.common.exception;


import com.luaj.elasticsearch.common.enums.EmBusinessError;
import com.luaj.elasticsearch.common.model.CommonError;
import lombok.Getter;

/**
 * @author 卢安杰
 * @date 2020-11-20 19:23
 */
@Getter
public class BusinessException extends Exception {
    private CommonError commonError;

    public BusinessException(EmBusinessError error) {
        super();
        this.commonError=new CommonError(error.getCode(),error.getMsg());
    }
    public BusinessException(EmBusinessError error,String msg) {
        super();
        this.commonError=new CommonError(error.getCode(),msg);
    }
}
